home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIChannelEventSink.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  143 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIChannelEventSink.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIChannelEventSink_h__
  6. #define __gen_nsIChannelEventSink_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIChannel; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIChannelEventSink */
  21. #define NS_ICHANNELEVENTSINK_IID_STR "6757d790-2916-498e-aaca-6b668a956875"
  22.  
  23. #define NS_ICHANNELEVENTSINK_IID \
  24.   {0x6757d790, 0x2916, 0x498e, \
  25.     { 0xaa, 0xca, 0x6b, 0x66, 0x8a, 0x95, 0x68, 0x75 }}
  26.  
  27. /**
  28.  * Implement this interface to receive control over various channel events.
  29.  * Channels will try to get this interface from a channel's
  30.  * notificationCallbacks or, if not available there, from the loadGroup's
  31.  * notificationCallbacks.
  32.  *
  33.  * These methods are called before onStartRequest, and should be handled
  34.  * SYNCHRONOUSLY.
  35.  */
  36. class NS_NO_VTABLE nsIChannelEventSink : public nsISupports {
  37.  public: 
  38.  
  39.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHANNELEVENTSINK_IID)
  40.  
  41.   /**
  42.      * This is a temporary redirect. New requests for this resource should
  43.      * continue to use the URI of the old channel.
  44.      *
  45.      * The new URI may be identical to the old one.
  46.      */
  47.   enum { REDIRECT_TEMPORARY = 1U };
  48.  
  49.   /**
  50.      * This is a permanent redirect. New requests for this resource should use
  51.      * the URI of the new channel (This might be an HTTP 301 reponse).
  52.      * If this flag is not set, this is a temporary redirect.
  53.      *
  54.      * The new URI may be identical to the old one.
  55.      */
  56.   enum { REDIRECT_PERMANENT = 2U };
  57.  
  58.   /**
  59.      * This is an internal redirect, i.e. it was not initiated by the remote
  60.      * server, but is specific to the channel implementation.
  61.      *
  62.      * The new URI may be identical to the old one.
  63.      */
  64.   enum { REDIRECT_INTERNAL = 4U };
  65.  
  66.   /**
  67.      * Called when a redirect occurs. This may happen due to an HTTP 3xx status
  68.      * code.
  69.      *
  70.      * @param oldChannel
  71.      *        The channel that's being redirected.
  72.      * @param newChannel
  73.      *        The new channel. This channel is not opened yet.
  74.      * @param flags
  75.      *        Flags indicating the type of redirect. A bitmask consisting
  76.      *        of flags from above.
  77.      *        One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be
  78.      *        set.
  79.      *
  80.      * @throw <any> Throwing an exception will cancel the load. No network
  81.      * request for the new channel will be made.
  82.      */
  83.   /* void onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags); */
  84.   NS_IMETHOD OnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, PRUint32 flags) = 0;
  85.  
  86. };
  87.  
  88. /* Use this macro when declaring classes that implement this interface. */
  89. #define NS_DECL_NSICHANNELEVENTSINK \
  90.   NS_IMETHOD OnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, PRUint32 flags); 
  91.  
  92. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  93. #define NS_FORWARD_NSICHANNELEVENTSINK(_to) \
  94.   NS_IMETHOD OnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, PRUint32 flags) { return _to OnChannelRedirect(oldChannel, newChannel, flags); } 
  95.  
  96. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  97. #define NS_FORWARD_SAFE_NSICHANNELEVENTSINK(_to) \
  98.   NS_IMETHOD OnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, PRUint32 flags) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnChannelRedirect(oldChannel, newChannel, flags); } 
  99.  
  100. #if 0
  101. /* Use the code below as a template for the implementation class for this interface. */
  102.  
  103. /* Header file */
  104. class nsChannelEventSink : public nsIChannelEventSink
  105. {
  106. public:
  107.   NS_DECL_ISUPPORTS
  108.   NS_DECL_NSICHANNELEVENTSINK
  109.  
  110.   nsChannelEventSink();
  111.  
  112. private:
  113.   ~nsChannelEventSink();
  114.  
  115. protected:
  116.   /* additional members */
  117. };
  118.  
  119. /* Implementation file */
  120. NS_IMPL_ISUPPORTS1(nsChannelEventSink, nsIChannelEventSink)
  121.  
  122. nsChannelEventSink::nsChannelEventSink()
  123. {
  124.   /* member initializers and constructor code */
  125. }
  126.  
  127. nsChannelEventSink::~nsChannelEventSink()
  128. {
  129.   /* destructor code */
  130. }
  131.  
  132. /* void onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags); */
  133. NS_IMETHODIMP nsChannelEventSink::OnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, PRUint32 flags)
  134. {
  135.     return NS_ERROR_NOT_IMPLEMENTED;
  136. }
  137.  
  138. /* End of implementation class template. */
  139. #endif
  140.  
  141.  
  142. #endif /* __gen_nsIChannelEventSink_h__ */
  143.